<template>
  <div class="sysm-b-modu boxsi ml50 mr50" :style="'height: '+viewHeight+'px;'">
    <div class="sysm-bmodu-box">
      <div class="pl24 pr24 h100p">
        <table cellpadding="0" cellspacing="0" width="100%" class="sysm-bmbox-table">
          <tbody>
            <tr>
              <td class="pb30" colspan="3">
                <h3>
                  核对入区人员信息
                  <!-- <a href="javascript:;" class="sysm-brbbom-btn true-obj fr mt10" @click="initReadCard()">快速身份录入</a> -->
                </h3>
              </td>
            </tr>
            <tr>
              <td width="300" rowspan="6" valign="top">
                <!-- <div class="xxtbwel-t-user"><img id="yyy" name="yyy" :src="showImgPath"  alt="" /></div> -->

                <div class="xxtbwel-tuser-image">
                  <div class="xxtbwel-tuimage-box">
                    <img
                      :src="showImgPath"
                      width="100%"
                      height="100%"
                      alt
                    />
                  </div>
                </div>
              </td>
              <td width="144" align="right" class="pr20">姓名：</td>
              <td>
                {{dataForm.identityTypeName}}
                <!-- <span class="sysm-hsxxtable-type">盗窃</span>
                <span class="sysm-hsxxtable-type">杀人</span>-->
              </td>
            </tr>
            <tr>
              <td align="right" class="pr20">证件类型：</td>
              <td>{{dataForm.loginName}}</td>
            </tr>
            <tr>
              <td align="right" class="pr20">身份证号：</td>
              <td>{{dataForm.identityTypeName}}</td>
            </tr>
            <tr>
              <td align="right" class="pr20">性别：</td>
              <td>{{sexName}}</td>
            </tr>
            <tr>
              <td align="right" class="pr20">出生日期：</td>
              <td>{{dataForm.birthday}}</td>
            </tr>
            <tr>
              <td align="right" class="pr20">户籍地址：</td>
              <td>{{dataForm.hometown}}</td>
            </tr>
          </tbody>
        </table>
        <div class="mt30 text_ac">
          <a
            href="javascript:;"
            class="sysm-brbbom-btn true-obj mt10"
            @click="doSave()"
          >确认并登记事由</a>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {getShowImgPath} from '@/utils'
export default {
  data() {
    return {
      viewHeight: 504,
      showImgPath:'',
      sexName:'',
      dataForm: {
        loginName: "",
        identityType: "1",
        identityTypeName: "身份证",
        identityNo: "",
        sex: "1",
        userType: "2",
        birthday: "",
        hometown: "",
        avatar: ""
      }
    }
  },
  created() {
    this.dataForm = this.vtp.get("userInfo");
    this.sexName=this.dataForm.sex=='1'?'男':'女';
    this.showImgPath = getShowImgPath(this.dataForm.avatar);
  },
  methods: {
    toRouter(o) {
      this.vtp.toRouter(this, o);
    },
    doSave(){
        this.$http({
                url: this.$http.adornUrl(
                    "/zfuser/zfinvolvedregistration/doSaveUserInfo"
                ),
                method: "post",
                data: this.$http.adornData(this.dataForm)
            }).then(({ data }) =>{
                if(data&&data.code==0){
                    this.vtp.set('userId',data.userId)
                    this.toRouter('rqsy')
                }else{
                    this.$message.error("系统异常，提交失败");
                }
            })
    }
  },
  components: {},
  mounted() {
    this.viewHeight = this.vtp.winHei(166);
    window.onresize = function() {
      let pageHeiVal = tipLayout.winHei() - 166;
      $(".sysm-b-modu").height(pageHeiVal);
    };
    // 下拉框start
    let _this = this;
    $("body").on("click", ".sysm-bmbtable-down input", function() {
      var $p = $(this).parent();
      $(".sysm-bmbtdown-list")
        .css("height", "250px")
        .css("overflow", "auto");
      $p.addClass("open-down")
        .children("ul")
        .stop(true)
        .slideDown(200);
      // $p.hasClass('open-down') ? $p.removeClass('open-down').children('ul').stop(true).slideUp(200) : $p.addClass('open-down').children('ul').stop(true).slideDown(200);
    });
    $("body").on("click", ".sysm-bmbtable-down ul li", function() {
      var html = $(this).html();
      _this.dataForm.identityType = $(this).attr("data");
      _this.dataForm.identityTypeName = html;
      $(this)
        .parents(".sysm-bmbtable-down")
        .children("input")
        .val(html)
        .parent()
        .removeClass("open-down")
        .children("ul")
        .stop(true)
        .slideUp(200);
    });
    $(".sysm-bmbtable-down ul").mouseleave(function() {
      $(this)
        .removeClass("open-down")
        .children("ul")
        .stop(true)
        .slideUp(200);
    });
    // 下拉框end
  }
};
</script>

<style>
</style>